<template>
  <!-- {{ route.path }} -->
  <a-config-provider :get-popup-container="getPopupContainer" :locale="zhCN">
    <!-- prefix-cls="document-ant" -->
    <router-view />
  </a-config-provider>
  <LoadingImage v-show="isLoading"></LoadingImage>
</template>

<script setup>
import { ref, watch } from 'vue';
import LoadingImage from '@/components/loadingComponent/index.vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import { ConfigProvider } from 'ant-design-vue';
import store from './store';
import 'dayjs/locale/zh-cn';
import { useRoute, useRouter } from 'vue-router';
const route = useRoute();
import { changeThemeColor } from '@/utils/theme.js';
const router = useRouter();
let isLoading = ref(false);
watch(store.state, (newName, oldName) => {
  isLoading.value = newName.user.isLoading;
});

dayjs.locale('en');

function getPopupContainer(el, dialogContext, triggerNode) {
  if (triggerNode) {
    return triggerNode.parentNode;
  }
  if (el) {
    return el.parentNode;
  }
  if (dialogContext) {
    return dialogContext.getDialogWrap();
  }
  if (!window.__MICRO_APP_BROWER_VIEW__) {
    return document.body;
  }
  return el ?? document.body ?? triggerNode;
}
ConfigProvider.config({
  getPopupContainer
});
let color = ref(store.state.user.setPrimaryColor);
</script>

<style lang="less">
img {
  border: none !important;
}
#app {
  width: 100%;
  height: 100%;
  // padding-top: 56px; // todo:发布测试等环境时删除
  background: #f2f2f2;
  font-family: Source Han Sans CN, Source Han Sans CN-Regular;
  // padding: 13px 120px 24px 120px;
}
* {
  box-sizing: border-box;
}
::-webkit-scrollbar {
  width: 5px;
  height: 80px;
}
::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background-color: #dee0e3 !important;
}
.ant-select-item-option-content,
.ant-picker-panels,
.ant-picker-panel {
  font-family: Source Han Sans CN, Source Han Sans CN-Regular !important;
}
// popup
.tj-popup__content {
  background: #5c5c5c !important;
  font-size: 14px !important;
  font-family: Source Han Sans CN, Source Han Sans CN-400;
  font-weight: 400;
  color: #ffffff !important;
}
.tj-popup__arrow:before {
  background: #5c5c5c !important;
}
</style>
